# -*- coding:utf-8 -*-

"""
计划类产品

"""
from aw import *
from autotest import *


class Test_002(TestCase):

    # 新人周增：ZC201810231642346085675
    # 新人月增：ZC201810231704586551135
    # 新人双月增：ZC201810231934317207970
    # 新人季增：ZC201810231935012555011

    def setUp(self):
        print("Test_001 setUp")
        Common.selectProduct("ZC201810231642346085675")
        Common.selectProductRate("ZC201810231935012555011")

        Common.dumpProduct("ZC201810231934317207970")
        Common.loadProduct("ZC201810231704586551135")

        Common.cleanCache("PD201809261944590653017")
        Common.cleanCache("1100111023")
        Common.cleanCache("1100099819") # DELETE FROM `finance_fixin_ws`.`t_update_guide` WHERE `id` = 60
        Common.getProducts()
        Common.getProducts(product_type=2)
        Common.getProducts(product_type=15)


    def test(self):
        Common.getRecordProduct(product_type=2)
        Common.getRecordProduct(product_type=15)


        Common.updateProduct("PD201810252035512483708--会员稳盈180天1",product_term=180)


        # 修改标的的状态为6募集结束，募集截止时间当前时间以前
        # 月增
        Common.updateProduct("ZC201810231704586551135",product_status=6,raise_end_time="2018-10-22 19:44:59",)
        # 双月增
        Common.updateProduct("ZC201810231934317207970",product_status=6,raise_end_time="2018-10-22 19:44:59",)


        Common.updateProduct("ZC201810231704586551135",product_status=6,raise_end_time="2018-10-22 19:44:59",)

        # 季增
        Common.updateProduct("ZC201810231935012555011",product_status=6,raise_end_time="2018-10-22 19:44:59",)



        Common.updateProduct("ZC201810242009257632033",public_time="2018-10-22 16:42:36")





    def tearDown(self):
        print("Test_001 tearDown")
